.matrix {
  position: relative;
  width: 100%;
  background: var(--color-bg-2);
  box-sizing: border-box;
  font-size: 12px;

  &.moving {
    .container {
      transition: transform 0.5s;
      cursor: copy;
    }
  }

  .viewport {
    position: relative;
    height: calc(100vh - 320px);
    width: 100%;
    overflow: hidden;
  }

  .loadWrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10;

    &.loading {
      display: flex;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      background-color: rgba(255, 255, 255, 40%);
    }
  }

  .corner {
    left: 0;
    top: 0;
    width: var(--matrix-axis-size);
    height: var(--matrix-axis-size);
    border: 1px solid var(--color-fill-2);
    background: var(--color-fill-2);
    // background-color: white;
    position: absolute;
    z-index: 2;
  }

  .axis {
    position: absolute;
    width: var(--matrix-axis-size);
    height: var(--matrix-axis-size);
    background: var(--color-fill-2);
    // background-color: white;
  }

  .container {
    user-select: none;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.15s;
    cursor: grab;

    &.moving {
      cursor: grabbing;
    }

    .item {
      position: absolute;
      width: var(--matrix-box-size);
      height: var(--matrix-box-size);
      border: 1px solid var(--color-border);
      background: var(--color-bg-2);
      box-sizing: content-box;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;

      .itemEdit {
        position: absolute;
        right: 5px;
        top: 5px;
        font-size: 12px;
        cursor: pointer;
      }

      &:hover {
        z-index: 3;
        border: 1px solid rgb(var(--arcoblue-2));
      }

      &.relative {
        z-index: 3;
        border: 1px solid rgb(var(--arcoblue-1));
        background-color: rgb(var(--arcoblue-1));
      }

      &.active {
        z-index: 4;
        border: 1px solid rgb(var(--arcoblue-3));
        background-color: rgb(var(--arcoblue-3));
      }
    }

    .unit {
      position: absolute;
      z-index: 1;
      color: rgb(var(--gray-10));
      font-weight: bold;
      width: var(--matrix-box-size);
      height: var(--matrix-axis-size);
      line-height: var(--matrix-axis-size);
      text-align: center;
      background: var(--color-fill-2);
      box-sizing: content-box;
      border: 1px solid var(--color-fill-2);

      &.lt {
        // height: var(--matrix-box-size);
        // width: var(--matrix-axis-size);
        // line-height: var(--matrix-axis-size);
        // writing-mode: vertical-lr;
        // text-orientation: upright;
        // transform:rotate3d(0, 0, 1, 90deg); //rotate3d(0, 0, 1, -90deg)
        // transform-origin:calc(50% -50px) calc(50% + 30px) ;
        transform: translate3d(
            calc(0% + var(--matrix-axis-size) / 2 - var(--matrix-box-size) / 2),
            calc(0% - var(--matrix-axis-size) / 2 + var(--matrix-box-size) / 2),
            0
          )
          rotate3d(0, 0, 1, -90deg);
      }

      &.relative {
        z-index: 3;
        background: var(--color-fill-4);
        border: 1px solid var(--color-fill-4);
      }
    }
  }
}

.search-form-wrapper {
  display: flex;
  border-bottom: 1px solid var(--color-border-1);
  margin-bottom: 20px;
}
